/**
 * Created by Lcp on 2018/3/5.
 */

var height = $('.project').height() - $('.caseName').height() - $('.caseDescription').height() - $('.caseInvolvedPeople').height() - $('.caseMoney').height() - $('.projectH3').height(),
    dataOne = [],//饼图数据
    dataOneCode = [],//饼图案件类型对应数字
    obj_3 = {
        data_3_Case: [24, 4, 22, 10, 21, 7, 3, 12, 3, 0, 0],
        data_3_Clue:[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        name: ["南明分局", "云岩分局", "花溪分局", "乌当分局", "白云分局", "经开分局", "开阳县分局", "息烽县分局", "修文县分局", "观山湖区分局", "清镇市分局"],
        no_Num:[42, 7, 55, 15, 32, 7, 7, 17, 3, 54, 0]
    },
    projectData = [],//专案要案
    newContentData = [],//最新警情数据
    eg = {};
eg.dwmc = [];//单位名称
eg.orgCode = [];//单位编码
eg.aqg = [];//安全感
eg.zdajfas = [];//重大案件
eg.nwrqcafs = [];//年万人倾财产案发数
eg.xxmapal = [];//现行命案破案书
eg.bdlxsapal = [];//八类重特大刑事案件破案率
eg.lqxsxzpal = [];//\'两抢\'刑事、行政案件破案率
eg.dqajpal = [];//盗窃案件破案率
eg.jcxzpapal = [];//接触性诈骗案件破案率
eg.fjcxzpapal = [];//非接触性诈骗案件破案率
eg.szxxxpal = [];//涉众型、新型违法犯罪案件受案率、答复率
eg.shcexss = [];//扫黑除恶工作(线索)
eg.shcexjs = [];//扫黑除恶工作(刑拘)
eg.shcepas = [];//扫黑除恶工作(破案)
eg.sqfzxs = [];//涉枪违法犯罪(线索)
eg.sqfzzg = [];//涉枪违法犯罪(战果)
eg.xadfdqpal = [];//小案打防破案率
eg.xadfjcxzppal = [];//小案打防接触性诈骗破案率
eg.xadfdzpal = [];//小案打防电诈破案率
eg.qsl = [];//盗抢骗工作起诉增长率
eg.zxl = [];//重刑率
eg.gpqsl = [];//拐骗工作起诉率
eg.gpcxal = [];//撤销案情况
eg.parls = [];//破案人脸
eg.pazws = [];//指纹
eg.padnas = [];//DNA
window.onresize = function(){
    window.location.reload();
}
time();
setInterval(function () {
    time();
},1000);
//全市案发数量统计
$.ajax({
    type:'get',
    url: baseUrls + 'showPage/caseCount',
    data: {
        time: 3,
        ajlx: '',
        beginTime: '',
        endTime: ''
    },
    // beforeSend: function(){
    //     Loading();
    // },
    success:function(data){
        closeLoading();
        if(data.responseCode == '1000'){
            //caseCountByType-全市案件统计
            if(data.content.caseCountByType.length > 0){
                dataOneCode = [];
                dataOne = [];
                for(var i=0;i<data.content.caseCountByType.length;i++){
                    if(data.content.caseCountByType[i].CODE != '0'){
                        dataOneCode.push(data.content.caseCountByType[i].CODE);
                        dataOne.push(
                            [data.content.caseCountByType[i].NAME + '(' + nulls(data.content.caseCountByType[i].AMOUNT) + ')',Number(data.content.caseCountByType[i].AMOUNT)]
                        )
                    }

                }
                option_1();
            }
        }else{
            Msg();
        }
    },
    error:function(){
        closeLoading();
        Msg();
    }
});
//仪表盘数据
$.ajax({
    type: 'get',
    cache: false,
    url: baseUrls + 'homepage/tjxx',
    beforeSend: function(){
        Loading();
    },
    success: function(response){
        closeLoading();
        if(response.responseCode == '1000'){
            for(var i = 0; i < response.content.length; i++){
                var data = response.content[i];
                eg.dwmc.push(data.qxmc);//单位名称
                eg.orgCode.push(data.qxbh);//单位编码
                eg.aqg.push(data.aqg == null ? 0 : Number(data.aqg));//安全感
                eg.zdajfas.push(data.zdajfas == null ? 0 : Number(data.zdajfas));//重大案件
                eg.nwrqcafs.push(data.nwrqcafs == null ? 0 : Number(data.nwrqcafs));//年万人倾财产案发数
                eg.xxmapal.push(data.xxmapal == null ? 0 : Number(data.xxmapal));//现行命案破案书
                eg.bdlxsapal.push(data.bdlxsapal == null ? 0 : Number(data.bdlxsapal));//八类重特大刑事案件破案率
                eg.lqxsxzpal.push(data.lqxsxzpal == null ? 0 : Number(data.lqxsxzpal));//\'两抢\'刑事、行政案件破案率
                eg.dqajpal.push(data.dqajpal == null ? 0 : Number(data.dqajpal));//盗窃案件破案率
                eg.jcxzpapal.push(data.jcxzpapal == null ? 0 : Number(data.jcxzpapal));//接触性诈骗案件破案率
                eg.fjcxzpapal.push(data.fjcxzpapal == null ? 0 : Number(data.fjcxzpapal));//非接触性诈骗案件破案率
                eg.szxxxpal.push(data.szxxxpal == null ? 0 : Number(data.szxxxpal));//涉众型、新型违法犯罪案件受案率、答复率
                eg.shcexss.push(data.shcexss == null ? 0 : Number(data.shcexss));//扫黑除恶工作(线索)
                eg.shcexjs.push(data.shcexjs == null ? 0 : Number(data.shcexjs));//扫黑除恶工作(刑拘)
                eg.shcepas.push(data.shcepas == null ? 0 : Number(data.shcepas));//扫黑除恶工作(破案)
                eg.sqfzxs.push(data.sqfzxs == null ? 0 : Number(data.sqfzxs));//涉枪违法犯罪(线索)
                eg.sqfzzg.push(data.sqfzzg == null ? 0 : Number(data.sqfzzg));//涉枪违法犯罪(战果)
                eg.xadfdqpal.push(data.xadfdqpal == null ? 0 : Number(data.xadfdqpal));//小案打防破案率
                eg.xadfjcxzppal.push(data.xadfjcxzppal == null ? 0 : Number(data.xadfjcxzppal));//小案打防接触性诈骗破案率
                eg.xadfdzpal.push(data.xadfdzpal == null ? 0 : Number(data.xadfdzpal));//小案打防电诈破案率
                eg.qsl.push(data.qsl == null ? 0 : Number(data.qsl));//盗抢骗工作起诉增长率
                eg.zxl.push(data.zxl == null ? 0 : Number(data.zxl));//重刑率
                eg.gpqsl.push(data.gpqsl == null ? 0 : Number(data.gpqsl));//拐骗工作起诉率
                eg.gpcxal.push(data.gpcxal == null ? 0 : Number(data.gpcxal));//撤销案情况
                eg.parls.push(data.parls == null ? 0 : Number(data.parls));//破案人脸
                eg.pazws.push(data.pazws == null ? 0 : Number(data.pazws));//指纹
                eg.padnas.push(data.padnas == null ? 0 : Number(data.padnas));//DNA
            }
            var allAqg = 0;
            for(var i = 0; i < eg.aqg.length; i++){//安全感
                allAqg += Number(eg.aqg[i]);
            }
            var zdajfas = 0;
            for(var i = 0; i < eg.zdajfas.length; i++){//重大案件
                zdajfas += Number(eg.zdajfas[i]);
            }
            var nwrqcafs = 0;
            for(var i = 0; i < eg.nwrqcafs.length; i++){//年万人倾财产案发数
                nwrqcafs += Number(eg.nwrqcafs[i]);
            }
            var xxmapal = 0;
            for(var i = 0; i < eg.xxmapal.length; i++){//现行命案破案书
                xxmapal += Number(eg.xxmapal[i]);
            }
            var bdlxsapal = 0;
            for(var i = 0; i < eg.bdlxsapal.length; i++){//八类重特大刑事案件破案率
                bdlxsapal += Number(eg.bdlxsapal[i]);
            }
            var lqxsxzpal = 0;
            for(var i = 0; i < eg.lqxsxzpal.length; i++){//\'两抢\'刑事、行政案件破案率
                lqxsxzpal += Number(eg.lqxsxzpal[i]);
            }
            var dqajpal = 0;
            for(var i = 0; i < eg.dqajpal.length; i++){//盗窃案件破案率
                dqajpal += Number(eg.dqajpal[i]);
            }
            var jcxzpapal = 0;
            for(var i = 0; i < eg.jcxzpapal.length; i++){//接触性诈骗案件破案率
                jcxzpapal += Number(eg.jcxzpapal[i]);
            }
            var fjcxzpapal = 0;
            for(var i = 0; i < eg.fjcxzpapal.length; i++){//非接触性诈骗案件破案率
                fjcxzpapal += Number(eg.fjcxzpapal[i]);
            }
            var szxxxpal = 0;
            for(var i = 0; i < eg.szxxxpal.length; i++){//涉众型、新型违法犯罪案件受案率、答复率
                szxxxpal += Number(eg.szxxxpal[i]);
            }
            var shcexss = 0;
            for(var i = 0; i < eg.shcexss.length; i++){//扫黑除恶工作(线索)
                shcexss += Number(eg.shcexss[i]);
            }
            var shcexjs = 0;
            for(var i = 0; i < eg.shcexss.length; i++){//扫黑除恶工作(刑拘)
                shcexjs += Number(eg.shcexjs[i]);
            }
            var shcepas = 0;
            for(var i = 0; i < eg.shcepas.length; i++){//扫黑除恶工作(破案)
                shcepas += Number(eg.shcepas[i]);
            }
            var sqfzxs = 0;
            for(var i = 0; i < eg.sqfzxs.length; i++){//涉枪违法犯罪(线索)
                sqfzxs += Number(eg.sqfzxs[i]);
            }
            var sqfzzg = 0;
            for(var i = 0; i < eg.sqfzzg.length; i++){//涉枪违法犯罪(战果)
                sqfzzg += Number(eg.sqfzzg[i]);
            }
            var xadfdqpal = 0;
            for(var i = 0; i < eg.xadfdqpal.length; i++){//小案打防破案率
                xadfdqpal += Number(eg.xadfdqpal[i]);
            }
            var xadfjcxzppal = 0;
            for(var i = 0; i < eg.xadfjcxzppal.length; i++){//小案打防接触性诈骗破案率
                xadfjcxzppal += Number(eg.xadfjcxzppal[i]);
            }
            var xadfdzpal = 0;
            for(var i = 0; i < eg.xadfdzpal.length; i++){//小案打防电诈破案率
                xadfdzpal += Number(eg.xadfdzpal[i]);
            }
            var qsl = 0;
            for(var i = 0; i < eg.qsl.length; i++){//盗抢骗工作起诉增长率
                qsl += Number(eg.qsl[i]);
            }
            var zxl = 0;
            for(var i = 0; i < eg.zxl.length; i++){//重刑率
                zxl += Number(eg.zxl[i]);
            }
            var gpqsl = 0;
            for(var i = 0; i < eg.gpqsl.length; i++){//拐骗工作起诉率
                gpqsl += Number(eg.gpqsl[i]);
            }
            var gpcxal = 0;
            for(var i = 0; i < eg.gpcxal.length; i++){//撤销案情况
                gpcxal += Number(eg.gpcxal[i]);
            }
            var data = [
                {//95%以上 群众安全感满意度
                    percent: (allAqg / 11).toFixed(2) / 100 > 1 ? 1 : (allAqg / 11).toFixed(2) / 100,
                    num: (allAqg / 11).toFixed(2),
                    name: '安全感',
                    color: Math.ceil(allAqg / 11) >= 95 ?  '#00ffb0' : '#fe106e'
                },
                {//0起否则0% 重大敏感性案件
                    percent: 1,
                    num: zdajfas,
                    name: '发案数量',
                    color: zdajfas > 0 ? '#fe106e' : '#00ffb0'
                },
                {//年发案50起以内 年万人侵害财产
                    percent: (nwrqcafs / 11).toFixed(2) / 100 > 1 ? 1 : (nwrqcafs / 11).toFixed(2) / 100,
                    num: (nwrqcafs / 11).toFixed(2),
                    name: '发案数量',
                    color: (nwrqcafs / 11).toFixed(2) > 50 ? '#fe106e' : '#00ffb0'
                },
                {//100%及格 命案破案率
                    percent: (xxmapal / 11).toFixed(2) / 100 > 1 ? 1 : (xxmapal / 11).toFixed(2) / 100,
                    num: (xxmapal / 11).toFixed(2),
                    name: '破案率',
                    color: (xxmapal / 11).toFixed(2) >= 100 ? '#00ffb0' : '#fe106e'
                },
                {//90以上 八大类案件
                    percent: (bdlxsapal / 11).toFixed(2) / 100 > 1 ? 1 : (bdlxsapal / 11).toFixed(2) / 100,
                    num: (bdlxsapal / 11).toFixed(2),
                    name: '破案率',
                    color: (bdlxsapal / 11).toFixed(2) >= 90 ? '#00ffb0' : '#fe106e'
                },
                { // 90%以上 两抢刑事行政
                    percent: (lqxsxzpal / 11).toFixed(2) / 100 > 1 ? 1 : (lqxsxzpal / 11).toFixed(2) / 100,
                    num: (lqxsxzpal / 11).toFixed(2),
                    name: '破案率',
                    color: (lqxsxzpal / 11).toFixed(2) >= 90 ? '#00ffb0' : '#fe106e'
                },
                {//40%以上 盗窃案
                    percent: (dqajpal / 11).toFixed(2) / 100 > 1 ? 1 : (dqajpal / 11).toFixed(2) / 100,
                    num: (dqajpal / 11).toFixed(2),
                    name: '破案率',
                    color: (dqajpal / 11).toFixed(2) >= 40 ? '#00ffb0' : '#fe106e'
                },
                {// 60% 接触性诈骗
                    percent: (jcxzpapal / 11).toFixed(2) / 100 > 1 ? 1 : (jcxzpapal / 11).toFixed(2) / 100,
                    num: (jcxzpapal / 11).toFixed(2),
                    name: '破案率',
                    color: (jcxzpapal / 11).toFixed(2) >= 60 ? '#00ffb0' : '#fe106e'
                },
                {//10%以上 非接触性诈骗
                    percent: (fjcxzpapal / 11).toFixed(2) / 100 > 1 ? 1 : (fjcxzpapal / 11).toFixed(2) / 100,
                    num: (fjcxzpapal / 11).toFixed(2),
                    name: '破案率',
                    color: (fjcxzpapal / 11).toFixed(2) >= 10 ? '#00ffb0' : '#fe106e'
                },
                {//100% 案件回复率
                    percent: (szxxxpal / 11).toFixed(2) / 100 > 1 ? 1 : (szxxxpal / 11).toFixed(2) / 100,
                    num: (szxxxpal / 11).toFixed(2),
                    name: '破案率',
                    color: (szxxxpal / 11).toFixed(2) >= 100 ? '#00ffb0' : '#fe106e'
                }
            ];
            echarts_1(data);
            admissionRate($('.peopleFace'));
            $('.numOne').html(shcepas);
            $('.numTwo').html(sqfzxs);
            $('.numThree').html((xadfjcxzppal / 11).toFixed(2)+ '%');
            $('.numFour').html((qsl / 11).toFixed(2)+ '%');
            $('.numFive').html((zxl / 11).toFixed(2)+ '%');
            $('.numSix').html((gpqsl / 11).toFixed(2)+ '%');
        }else{
            Msg();
        }
    },
    error: function(){
        closeLoading();
        Msg();
    }
})
//大屏附件
$.ajax({
    type: 'get',
    cache: false,
    url: baseUrls + 'homepage/fj',
    beforeSend: function(){
        Loading();
    },
    data: {
        page: 1,
        size: 6
    },
    success: function(response){
        closeLoading();
        if(response.responseCode == '1000'){
            $('.faceImg').html('');
            response.content.list.forEach(function(item,index){
                $('.faceImg').append('<div class="faceImgDiv"><span><img src="'+ item.urllj +'" onerror="nofind(this)" onclick="openImg(this)" title="'+ item.wjmc +'"></span><p class="imgDescribtion">'+ item.wjmc +'</p></div>');
            });
            photoScroll();
        }else{
            Msg();
        }
    },
    error: function(){
        closeLoading();
        Msg();
    }
})
//专案要案
$.ajax({
    type: 'get',
    cache: false,
    url: baseUrls + 'homepage/zaya',
    beforeSend: function(){
        Loading();
    },
    data: {
        page: 1,
        size: 3
    },
    success: function(response){
        closeLoading();
        if(response.responseCode == '1000'){
            projectData = [];
            response.content.list.forEach(function(item,index){
                projectData.push({
                    name: item.ajmc,
                    description: item.ajqk,
                    involvedPeople: item.zbqk,
                    money: item.gzjh
                });
            });
            if(projectData.length > 0){
                $('.caseName').html(projectData[0].name);
                $('.caseDescription').html(projectData[0].description);
                $('.caseInvolvedPeople').html(projectData[0].involvedPeople);
                $('.caseMoney').html(projectData[0].money);
                projectScroll();
            }
        }else{
            Msg();
        }
    },
    error: function(){
        closeLoading();
        Msg();
    }
})
//最新警情
$.ajax({
    type: 'get',
    cache: false,
    url: baseUrls + 'homepage/zxjq',
    data: {
        page: 1,
        size: 5
    },
    beforeSend: function(){
        Loading();
    },
    success: function(response){
        closeLoading();
        if(response.responseCode == '1000'){
            newContentData = [];
            response.content.list.forEach(function(item,index){
                newContentData.push({
                    type: item.jqlx,
                    date: item.afsj,
                    description: item.jqms
                });
            });
            if(newContentData.length > 0){
                $('.newCaseType').html(newContentData[0].type);
                $('.caseData').html(newContentData[0].date);
                $('.newRight').html(newContentData[0].description);
                newContentScroll();
            }
        }else{
            Msg();
        }
    },
    error: function(){
        closeLoading();
        Msg();
    }
})
//全市录入统计
// $.ajax({
//     type:'get',
//     url: baseUrls + 'showPage/inputCount',
//     data: {
//         time: 3
//     },
//     success:function(data){
//         if(data.responseCode == '1000'){
//             //case和clue--全市录入情况
//             obj_3 = {
//                 name:[],
//                 data_3_Clue:[],
//                 no_Num: [],
//                 data_3_Case:[]
//             };
//             for(var i = 0;i<data.content.case.length;i++) {
//                 obj_3.name.push(data.content.case[i].SHORTNAME);
//                 obj_3.data_3_Case.push(data.content.case[i].AMOUNT);
//                 var flag = true;
//                 for (var j = 0; j < data.content.clue.length; j++) {
//                     if (data.content.clue[j].ORGCODE == data.content.case[i].ORGCODE){
//                         obj_3.data_3_Clue.push(data.content.clue[j].HAS_NUM);
//                         obj_3.no_Num.push(data.content.clue[j].NO_NUM);
//                         flag = false;
//                         break;
//                     }
//                 }
//                 if(flag){
//                     obj_3.data_3_Clue.push(0);
//                     obj_3.no_Num.push(0);
//                 }
//             }
//             option_3(obj_3);
//         }else{
//
//         }
//     },
//     error:function(){
//
//     }
// });
//人脸比对结果
// $.ajax({
//     type: 'get',
//     url: baseUrls + 'showPage/newestInfo',
//     data: {
//         time: 3
//     },
//     beforeSend: function(){
//         Loading();
//     },
//     success: function (data) {
//         closeLoading();
//         if(data.responseCode == '1000'){
//             //轮播开始
//             $('.faceImg').html('');
//             if(data.content.photo.length > 0){
//                 for(var i=0;i<data.content.photo.length;i++){
//                     var newDiv = '<div class="faceImgDiv"><span><img src="'+ data.content.photo[i].WLLJ +'"  onerror="nofind(this)" onclick="openImg(this)" title="'+ (i + 1) +'"></span><p class="imgDescribtion">'+ nulls(data.content.photo[i].AJMC) +'</p></div>';
//                     $('.faceImg').append(newDiv);
//                 }
//             }else{
//                 for(var i = 0;i < 6;i++){
//                     var newDiv = '<div class="faceImgDiv"><span><img src="screen/img/demo'+ (i+1) +'.jpg" alt="'+ (i + 1) +'" onerror="nofind(this)" onclick="openImg(this)" title="'+ (i + 1) +'"></span><p class="imgDescribtion">描述'+ i +'</p></div>';
//                     $('.faceImg').append(newDiv);
//                 }
//             }
//         }else{
//             for(var i = 0;i < 6;i++){
//                 var newDiv = '<div class="faceImgDiv"><span><img src="screen/img/demo'+ (i+1) +'.jpg" alt="'+ (i + 1) +'" onerror="nofind(this)" onclick="openImg(this)" title="'+ (i + 1) +'"></span><p class="imgDescribtion">描述'+ i +'</p></div>';
//                 $('.faceImg').append(newDiv);
//             }
//         }
//         photoScroll();
//     },
//     error: function(){
//         closeLoading();
//         //轮播开始
//         $('.faceImg').html('');
//         for(var i = 0;i < 6;i++){
//             var newDiv = '<div class="faceImgDiv"><span><img src="screen/img/demo'+ (i+1) +'.jpg" alt="'+ (i + 1) +'" onerror="nofind(this)" onclick="openImg(this)" title="'+ (i + 1) +'"></span><p class="imgDescribtion">描述'+ i +'</p></div>';
//             $('.faceImg').append(newDiv);
//         }
//         photoScroll();
//     }
// });
//专案要案轮播
function projectScroll(){
    var Index = 0;
    setInterval(function(){
        $('.caseName').animate({
            marginTop: '-20px',
            opacity:  0
        },700);
        $('.caseDescription').animate({
            marginLeft: '-100px',
            opacity:  0
        },700);
        $('.caseInvolvedPeople').animate({
            marginTop: '-20px',
            opacity:  0
        },700);
        $('.caseMoney').animate({
            marginLeft: '-100px',
            opacity:  0
        },700);
        setTimeout(function(){
            $('.caseName').html(projectData[Index].name);
            $('.caseDescription').html(projectData[Index].description);
            $('.caseInvolvedPeople').html(projectData[Index].involvedPeople);
            $('.caseMoney').html(projectData[Index].money);
        },700);
        if(Index >= projectData.length - 1){
            Index = 0;
        }else{
            Index ++;
        }
        $('.caseName').animate({
            marginTop: 0,
            opacity:  1
        },700);
        $('.caseDescription').animate({
            marginLeft: 0,
            opacity:  1
        },700);
        $('.caseInvolvedPeople').animate({
            marginTop: 0,
            opacity:  1
        },700);
        $('.caseMoney').animate({
            marginLeft: 0,
            opacity:  1
        },700);
        //peopleRelationship();人际关系图
    },10000)
}
//最新警情轮播
function newContentScroll(){
    var Index = 0;
    setInterval(function(){
        $('.newCaseType').animate({
            opacity:  0
        },700);
        $('.caseData').animate({
            opacity:  0
        },700);
        $('.newRight').animate({
            opacity:  0
        },700);
        setTimeout(function(){
            $('.newCaseType').html(newContentData[Index].type);
            $('.caseData').html(newContentData[Index].date);
            $('.newRight').html(newContentData[Index].description);
        },700);
        if(Index >= newContentData.length - 1){
            Index = 0;
        }else{
            Index ++;
        }
        $('.newCaseType').animate({
            opacity:  1
        },700);
        $('.caseData').animate({
            opacity:  1
        },700);
        $('.newRight').animate({
            opacity:  1
        },700);
    },10000)
}

//获取时间
function time(){
    var myDate = new Date();
    var year = myDate.getFullYear();//获取当前年
    var yue = myDate.getMonth()+1;//获取当前月
    var date = myDate.getDate();//获取当前日
    var h = myDate.getHours();//获取当前小时数(0-23)
    var m = myDate.getMinutes();//获取当前分钟数(0-59)
    var s = myDate.getSeconds();//获取当前秒
    if(yue<10){
        yue = "0"+yue;
    }
    if(date<10){
        date= "0"+ date;
    }
    if(h<10){
        h="0"+h;
    }
    if(s<10){
        s="0"+s;
    }
    if(m<10){
        m="0"+m;
    }
    $(".topTime").html(h + ":" + m + ":" + s);
    $(".topYear").html(year + "年" + yue + "月" + date + "日");
    return year+"-"+yue+"-"+date;
};
//仪表盘
function echarts_1(data){
    var common = {
            type:'gauge',
            splitNumber: 10,       // 分割段数，默认为5
            axisTick: {            // 坐标轴小标记
                splitNumber: 10,   // 每份split细分多少段
                length :7,        // 属性length控制线长
                lineStyle: {       // 属性lineStyle控制线条样式
                    color: 'auto'
                }
            },
            axisLabel: {           // 坐标轴文本标签，详见axis.axisLabel
                show: false,
                textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                    color: 'auto'
                }
            },
            splitLine: {           // 分隔线
                show: true,        // 默认显示，属性show控制显示与否
                length: 15,         // 属性length控制线长
                lineStyle: {       // 属性lineStyle（详见lineStyle）控制线条样式
                    color: 'auto'
                }
            },
            pointer : {
                width : 3 //指针宽度
            },
            title : {
                show : true,
                offsetCenter: [0, '-40%'],       // x, y，单位px
                textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                    fontWeight: 'normal',
                    fontSize: 12,
                    color: '#aec3fa'
                }
            },
            textStyle: {
                fontSize: 12,
                fontWeight: 'normal',
                color: '#cbd9fe'
            },
            time: 5000,
            width: 5,
            fontSize: 14 //字体大小
        },
        option_1 = {
            title: {
                text: '群众安全感满意度',
                x: 'center',
                y: 'bottom',
                textStyle: common.textStyle
            },
            animationDuration: common.time,
            series : [
                {
                    type: common.type,
                    splitNumber: common.splitNumber,
                    axisTick: common.axisTick,
                    axisLabel: common.axisLabel,
                    splitLine: common.splitLine,
                    pointer: common.pointer,
                    title: common.title,
                    detail : {
                        formatter:'{value}%',
                        textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                            color: 'auto',
                            fontWeight: 'bolder',
                            fontSize: common.fontSize
                        }
                    },
                    axisLine: {            // 坐标轴线
                        lineStyle: {       // 属性lineStyle控制线条样式
                            color: [[data[0].percent, data[0].color],[1, '#3444a3']],
                            width: common.width
                        }
                    },
                    data:[{value: data[0].num, name: data[0].name}]
                }
            ]
        },
        option_2 = {
            title: {
                text: '重大性案件、敏感性案件',
                x: 'center',
                y: 'bottom',
                textStyle: common.textStyle
            },
            animationDuration: common.time,
            series : [
                {
                    type: common.type,
                    splitNumber: common.splitNumber,
                    axisTick: common.axisTick,
                    axisLabel: common.axisLabel,
                    splitLine: common.splitLine,
                    pointer: common.pointer,
                    title: common.title,
                    detail : {
                        formatter:'{value}起',
                        textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                            color: 'auto',
                            fontWeight: 'bolder',
                            fontSize: 14
                        }
                    },
                    axisLine: {            // 坐标轴线
                        lineStyle: {       // 属性lineStyle控制线条样式
                            color: [[data[1].percent, data[1].color],[1, '#3444a3']],
                            width: common.width
                        }
                    },
                    data:[{value: data[1].num, name: data[1].name}]
                }
            ]
        },
        option_3 = {
            title: {
                text: '年万人侵财类刑事发案数',
                x: 'center',
                y: 'bottom',
                textStyle: common.textStyle
            },
            animationDuration: common.time,
            series : [
                {
                    type: common.type,
                    splitNumber: common.splitNumber,
                    axisTick: common.axisTick,
                    axisLabel: common.axisLabel,
                    splitLine: common.splitLine,
                    pointer: common.pointer,
                    title: common.title,
                    detail : {
                        formatter:'{value}%',
                        textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                            color: 'auto',
                            fontWeight: 'bolder',
                            fontSize: common.fontSize
                        }
                    },
                    axisLine: {            // 坐标轴线
                        lineStyle: {       // 属性lineStyle控制线条样式
                            color: [[data[2].percent, data[2].color],[1, '#3444a3']],
                            width: common.width
                        }
                    },
                    data:[{value: data[2].num, name: data[2].name}]
                }
            ]
        },
        option_4 = {
            title: {
                text: '现行命案破案率',
                x: 'center',
                y: 'bottom',
                textStyle: common.textStyle
            },
            animationDuration: common.time,
            series : [
                {
                    type: common.type,
                    splitNumber: common.splitNumber,
                    axisTick: common.axisTick,
                    axisLabel: common.axisLabel,
                    splitLine: common.splitLine,
                    pointer: common.pointer,
                    title: common.title,
                    detail : {
                        formatter:'{value}%',
                        textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                            color: 'auto',
                            fontWeight: 'bolder',
                            fontSize: common.fontSize
                        }
                    },
                    axisLine: {            // 坐标轴线
                        lineStyle: {       // 属性lineStyle控制线条样式
                            color: [[data[3].percent, data[3].color],[1, '#3444a3']],
                            width: common.width
                        }
                    },
                    data:[{value: data[3].num, name: data[3].name}]
                }
            ]
        },
        option_5 = {
            title: {
                text: '八类重特大刑事案件破案率',
                x: 'center',
                y: 'bottom',
                textStyle: common.textStyle
            },
            animationDuration: common.time,
            series : [
                {
                    type: common.type,
                    splitNumber: common.splitNumber,
                    axisTick: common.axisTick,
                    axisLabel: common.axisLabel,
                    splitLine: common.splitLine,
                    pointer: common.pointer,
                    title: common.title,
                    detail : {
                        formatter:'{value}%',
                        textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                            color: 'auto',
                            fontWeight: 'bolder',
                            fontSize: common.fontSize
                        }
                    },
                    axisLine: {            // 坐标轴线
                        lineStyle: {       // 属性lineStyle控制线条样式
                            color: [[data[4].percent, data[4].color],[1, '#3444a3']],
                            width: common.width
                        }
                    },
                    data:[{value: data[4].num, name: data[4].name}]
                }
            ]
        },
        option_6 = {
            title: {
                text: '"两抢"刑事、行政案件破案率',
                x: 'center',
                y: 'bottom',
                textStyle: common.textStyle
            },
            animationDuration: common.time,
            series : [
                {
                    type: common.type,
                    splitNumber: common.splitNumber,
                    axisTick: common.axisTick,
                    axisLabel: common.axisLabel,
                    splitLine: common.splitLine,
                    pointer: common.pointer,
                    title: common.title,
                    detail : {
                        formatter:'{value}%',
                        textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                            color: 'auto',
                            fontWeight: 'bolder',
                            fontSize: common.fontSize
                        }
                    },
                    axisLine: {            // 坐标轴线
                        lineStyle: {       // 属性lineStyle控制线条样式
                            color: [[data[5].percent, data[5].color],[1, '#3444a3']],
                            width: common.width
                        }
                    },
                    data:[{value: data[5].num, name: data[5].name}]
                }
            ]
        },
        option_7 = {
            title: {
                text: '盗窃案件破案率',
                x: 'center',
                y: 'bottom',
                textStyle: common.textStyle
            },
            animationDuration: common.time,
            series : [
                {
                    type: common.type,
                    splitNumber: common.splitNumber,
                    axisTick: common.axisTick,
                    axisLabel: common.axisLabel,
                    splitLine: common.splitLine,
                    pointer: common.pointer,
                    title: common.title,
                    detail : {
                        formatter:'{value}%',
                        textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                            color: 'auto',
                            fontWeight: 'bolder',
                            fontSize: common.fontSize
                        }
                    },
                    axisLine: {            // 坐标轴线
                        lineStyle: {       // 属性lineStyle控制线条样式
                            color: [[data[6].percent, data[6].color],[1, '#3444a3']],
                            width: common.width
                        }
                    },
                    data:[{value: data[6].num, name: data[6].name}]
                }
            ]
        },
        option_8 = {
            title: {
                text: '接触性诈骗案件破案率',
                x: 'center',
                y: 'bottom',
                textStyle: common.textStyle
            },
            animationDuration: common.time,
            series : [
                {
                    type: common.type,
                    splitNumber: common.splitNumber,
                    axisTick: common.axisTick,
                    axisLabel: common.axisLabel,
                    splitLine: common.splitLine,
                    pointer: common.pointer,
                    title: common.title,
                    detail : {
                        formatter:'{value}%',
                        textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                            color: 'auto',
                            fontWeight: 'bolder',
                            fontSize: common.fontSize
                        }
                    },
                    axisLine: {            // 坐标轴线
                        lineStyle: {       // 属性lineStyle控制线条样式
                            color: [[data[7].percent, data[7].color],[1, '#3444a3']],
                            width: common.width
                        }
                    },
                    data:[{value: data[7].num, name: data[7].name}]
                }
            ]
        },
        option_9 = {
            title: {
                text: '非接触性诈骗案件破案率',
                x: 'center',
                y: 'bottom',
                textStyle: common.textStyle
            },
            animationDuration: common.time,
            series : [
                {
                    type: common.type,
                    splitNumber: common.splitNumber,
                    axisTick: common.axisTick,
                    axisLabel: common.axisLabel,
                    splitLine: common.splitLine,
                    pointer: common.pointer,
                    title: common.title,
                    detail : {
                        formatter:'{value}%',
                        textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                            color: 'auto',
                            fontWeight: 'bolder',
                            fontSize: common.fontSize
                        }
                    },
                    axisLine: {            // 坐标轴线
                        lineStyle: {       // 属性lineStyle控制线条样式
                            color: [[data[8].percent, data[8].color],[1, '#3444a3']],
                            width: common.width
                        }
                    },
                    data:[{value: data[8].num, name: data[8].name}]
                }
            ]
        },
        option_10 = {
            title: {
                text: '涉众型、新型违法犯\n罪案件受案率、答复率',
                x: 'center',
                y: 'bottom',
                textStyle: common.textStyle
            },
            animationDuration: common.time,
            series : [
                {
                    type: common.type,
                    splitNumber: common.splitNumber,
                    axisTick: common.axisTick,
                    axisLabel: common.axisLabel,
                    splitLine: common.splitLine,
                    pointer: common.pointer,
                    title: common.title,
                    detail : {
                        formatter:'{value}%',
                        textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                            color: 'auto',
                            fontWeight: 'bolder',
                            fontSize: common.fontSize
                        }
                    },
                    axisLine: {            // 坐标轴线
                        lineStyle: {       // 属性lineStyle控制线条样式
                            color: [[data[9].percent, data[9].color],[1, '#3444a3']],
                            width: common.width
                        }
                    },
                    data:[{value: data[9].num, name: data[9].name}]
                }
            ]
        };
    var myChart_1 = echarts.init(document.getElementById('echart_1')),
        myChart_2 = echarts.init(document.getElementById('echart_2')),
        myChart_3 = echarts.init(document.getElementById('echart_3')),
        myChart_4 = echarts.init(document.getElementById('echart_4')),
        myChart_5 = echarts.init(document.getElementById('echart_5')),
        myChart_6 = echarts.init(document.getElementById('echart_6')),
        myChart_7 = echarts.init(document.getElementById('echart_7')),
        myChart_8 = echarts.init(document.getElementById('echart_8')),
        myChart_9 = echarts.init(document.getElementById('echart_9')),
        myChart_10 = echarts.init(document.getElementById('echart_10'));
    myChart_1.setOption(option_1);
    myChart_2.setOption(option_2);
    myChart_3.setOption(option_3);
    myChart_4.setOption(option_4);
    myChart_5.setOption(option_5);
    myChart_6.setOption(option_6);
    myChart_7.setOption(option_7);
    myChart_8.setOption(option_8);
    myChart_9.setOption(option_9);
    myChart_10.setOption(option_10);
}
//专案要案
function peopleRelationship(){
    var option = {
        animationDuration: 3000,
        legend: {
            x: 'right',
            y: 'top',
            data:[
                {
                    name: '家人',
                    textStyle: {
                        color: "#cbd9fe"
                    }
                },
                {
                    name: '朋友',
                    textStyle: {
                        color: "#cbd9fe"
                    }
                }
            ]
        },
        series : [
            {
                type:'force',
                name : "人物关系",
                ribbonType: false,
                categories : [
                    {
                        name: '人物'
                    },
                    {
                        name: '家人'
                    },
                    {
                        name:'朋友'
                    }
                ],
                itemStyle: {
                    normal: {
                        label: {
                            show: true,
                            textStyle: {
                                color: '#cbd9fe'
                            }
                        },
                        nodeStyle : {
                            brushType : 'both',
                            borderColor : 'rgba(255,215,0,0.4)',
                            borderWidth : 1
                        },
                        linkStyle: {
                            type: 'curve'
                        }
                    },
                    emphasis: {
                        label: {
                            show: false
                            // textStyle: null      // 默认使用全局文本样式，详见TEXTSTYLE
                        },
                        nodeStyle : {
                            //r: 30
                        },
                        linkStyle : {}
                    }
                },
                useWorker: false,
                minRadius : 15,
                maxRadius : 25,
                gravity: 1.1,
                scaling: 1.1,
                roam: 'move',
                nodes:[
                    {category:0, name: '任军', value : 10, label: '任军\n（主要）'},
                    {category:1, name: '任小红',value : 2},
                    {category:1, name: '任刚',value : 3},
                    {category:2, name: '刘佳',value : 5},
                    {category:2, name: '张菊',value : 8},
                    {category:2, name: '谢晓楠',value : 9},
                ],
                links : [
                    {source : '任小红', target : '任军', weight : 1, name: '女儿'},
                    {source : '任刚', target : '任军', weight : 2, name: '父亲'},
                    {source : '刘佳', target : '任军', weight : 3, name: '合伙人'},
                    {source : '张菊', target : '任军', weight : 1},
                    {source : '谢晓楠', target : '任军', weight : 6, name: '竞争对手'},
                ]
            }
        ],
        color: ['#9f1154','#4466f4','#24347e','#50123e','#ff106e']
    };
    function focus(param) {
        var data = param.data;
        var links = option.series[0].links;
        var nodes = option.series[0].nodes;
        if (
            data.source !== undefined
            && data.target !== undefined
        ) { //点击的是边
            var sourceNode = nodes.filter(function (n) {return n.name == data.source})[0];
            var targetNode = nodes.filter(function (n) {return n.name == data.target})[0];
            console.log("选中了边 " + sourceNode.name + ' -> ' + targetNode.name + ' (' + data.weight + ')');
        } else { // 点击的是点
            console.log("选中了" + data.name + '(' + data.value + ')');
        }
    }



    var casePeopleRelationship = echarts.init(document.getElementById('casePeopleRelationshipLeft'));
    casePeopleRelationship.clear();
    casePeopleRelationship.setOption(option);

}
//高发案件
highcaseEchart();
function highcaseEchart(){
    var option = {
        tooltip : {
            trigger: 'axis'
        },
        legend: {
            textStyle:{
                color: '#cbd9fe'
            },
            data:['盗窃案','诈骗案','抢劫案']
        },
        grid:{
            x: 30,
            y: 30,
            x2: 30,
            y2: 30,
            borderWidth: 0
        },
        calculable : false,
        xAxis : [
            {
                type : 'category',
                axisTick: {
                    show: false
                },
                splitLine:{
                    show: false,
                    color: ['#7f7c94'],
                    width: 1,
                    type: 'solid'
                },
                axisLine:{
                    lineStyle:{
                        color: '#7f7c94',
                        width: 1,
                        type: 'solid'
                    }
                },
                axisLabel:{
                    textStyle: {
                        color: '#cbd9fe'
                    }
                },
                data : ['1月','2月','3月'],

            }
        ],
        yAxis : [
            {
                type : 'value',
                axisTick: {
                    show: false
                },
                splitLine:{
                    show: true,
                    color: ['#7f7c94'],
                    width: 1,
                    type: 'solid'
                },
                axisLine:{
                    lineStyle:{
                        color: '#7f7c94',
                        width: 1,
                        type: 'solid'
                    }
                },
                axisLabel:{
                    textStyle: {
                        color: '#cbd9fe'
                    }
                },
            }
        ],
        series : [
            {
                name:'盗窃案',
                type:'bar',
                data:[10,20,30],
                barGap: 0,
                itemStyle:{
                    normal:{
                        barBorderRadius:[5,5,0,0]
                    }
                },
                markLine : {
                    data : [
                        {type : 'average', name: '平均值'}
                    ],
                    effect:{
                        show: true,
                        loop: true,
                        period: 15,
                        scaleSize : 2,
                    }
                }
            },
            {
                name:'诈骗案',
                type:'bar',
                data:[20,30,40],
                barGap: 0,
                itemStyle:{
                    normal:{
                        barBorderRadius:[5,5,0,0]
                    }
                },
                markLine : {
                    data : [
                        {type : 'average', name : '平均值'}
                    ]
                }
            },
            {
                name:'抢劫案',
                type:'bar',
                data:[50,30,40],
                barGap: 0,
                itemStyle:{
                    normal:{
                        barBorderRadius:[5,5,0,0]
                    }
                }
            }
        ],
        color: ['#009bfe','#33eeff','#9b70fa']
    };
    var highcaseEchart = echarts.init(document.getElementById('highcaseEchart'));
    highcaseEchart.clear();
    highcaseEchart.setOption(option);
}

//图片放大
function openImg(item){
    layer.photos({
        photos: '.slides'
        ,anim: 5 //0-6的选择，指定弹出图片动画类型，默认随机（请注意，3.0之前的版本用shift参数）
    });
}

/*饼图*/
function option_1(){
    var colors = ['#9f1154','#4466f4','#24347e','#50123e','#ff106e'];
    Highcharts.getOptions().colors = Highcharts.map(colors, function (color) {
        return {
            radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
            stops: [
                [0, color],
                [1, Highcharts.Color(color).brighten(-14).get('rgb')] // darken
            ]
        };
    });
    $('#cityColumn').highcharts({
        chart: {
            type: 'pie',
            options3d: {
                enabled: true,
                alpha: 45,
                beta: 0
            },
            backgroundColor:'rgba(23, 83, 93, 0)',
        },
        title: {
            text: ''
        },
        tooltip: {
            pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
        },
        exporting:{
            enabled: false
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                depth: 45,
                dataLabels: {
                    enabled: true,
                    format: '{point.name}',
                    useHTML: true,
                    style: {
                        color: '#cbd9fe',
                        fontSize:'12px',
                        fontWeight: 'normal',
                        fontFamily:'微软雅黑'
                    }
                }
            }
        },
        series: [{
            type: 'pie',
            name: '案件类别',
            data: dataOne,
            events: {
                click: function(e){
                    var iframeData = [],
                        Index = e.point.index,
                        kind = e.point.name.substring(0,e.point.name.lastIndexOf('('));
                    sessionStorage.setItem('color',e.point.color.stops[0][1]);
                    $.ajax({
                        type: 'get',
                        url: baseUrls + 'showPage/caseCountDetail',
                        data:{
                            endTime: '',
                            beginTime: '',
                            ajlx: dataOneCode[Index],
                        },
                        beforeSend:function(){
                            Loading();
                        },
                        success:function(response){
                            closeLoading();
                            if(response.responseCode == '1000'){
                                IframeData(response,iframeData);
                                var closeIndex = layer.open({
                                    type: 2,
                                    title: [`详情：${kind}`,'background: #3444a3;color:#fff'],
                                    skin: 'layui-layer-rim', //加上边框
                                    area: ['1100px', '700px'], //宽高
                                    scrollbar: false,
                                    shadeClose: true,
                                    move: false,
                                    content:'screen/data.html?' + iframeData + '&'+ dataOneCode[Index] +'&' + encodeURI(kind),
                                    success:function (layero,index) {
                                        $('.layui-layer.layui-layer-iframe.layui-layer-rim').css({display: 'block'});
                                    },
                                    cancel: function(layero,index){
                                        layer.close(closeIndex);
                                    }
                                });
                            }else{
                                Msg();
                            }
                        },
                        error:function(){
                            closeLoading();
                            Msg();
                        }
                    })
                }
            }
        }]
    });
}
//三项破案会战
function admissionRate(item){
    var Index = $(item).index(),
        num = 0;
    if(Index == 0){
        var parls = 0;
        for(var i = 0; i < eg.parls.length; i++){//人脸
            parls += Number(eg.parls[i]);
        }
        num = parls;
    }
    if(Index == 1){
        var pazws = 0;
        for(var i = 0; i < eg.pazws.length; i++){//指纹
            pazws += Number(eg.pazws[i]);
        }
        num = pazws;
    }
    if(Index == 2){
        var padnas = 0;
        for(var i = 0; i < eg.padnas.length; i++){//DNA
            padnas += Number(eg.padnas[i]);
        }
        num = padnas;
    }
    if($(item).hasClass('admissionRateActive')){
        Msg('当前状态已选中');
    }else{
        $(item).addClass('admissionRateActive').siblings().removeClass('admissionRateActive');
        $('.admissionRateNum').html(num);
    }
}
function admissionRates(){
    var Index = $('.admissionRateTitles').find('.admissionRateActive').index();
    if(Index == 0){
        caseTypeDetail('人脸',16);
    }
    if(Index == 1){
        caseTypeDetail('指纹',17);
    }
    if(Index == 2){
        caseTypeDetail('DNA',18);
    }
}

//全市录入情况
function option_3(obj_3){
    // cy 如果是负值 则表示从上到下的渐变，如果是正值则表示上边是浅色，下面是深色
    // brighten(14)正数表示变浅，负值是加深
    var colors = ['#fe106e','#009bfe','#4466f4'];
    Highcharts.getOptions().colors = Highcharts.map(colors, function (color) {
        return {
            radialGradient: { cx:0, cy: 1,r:2.3 },
            stops: [[0, color], [2, Highcharts.Color(color).brighten(-14).get('rgb')] // darken
            ]
        };
    });
    $('#cityEntryMsg').highcharts({
        chart: {
            type: 'column',
            backgroundColor:'rgba(23, 83, 93, 0)',
            options3d: {
                enabled: true,
                alpha: 0,
                beta: 0,
                viewDistance: 20,
                depth: 100
            },
            marginBottom: 65,
            animation: {
                duration: 6000
            },
            marginTop: 20,
            // marginRight: 40
        },
        exporting:{
            enabled: false
        },
        title: {
            text: ''
        },
        xAxis: {
            categories: obj_3.name,
            gridLineWidth: 0,
            labels: {
                formatter: function () {
                    return this.value
                },
                style: {
                    color: '#cbd9fe',
                    fontSize:'12px',
                    fontFamily:'微软雅黑'
                }
            },
            lineWidth: 1,
        },
        yAxis: {
            allowDecimals: false,
            gridLineWidth: 0,
            min: 0,
            title: {
                text: ''
            },
            labels: {
                formatter: function () {
                    return this.value
                },
                style: {
                    color: '#cbd9fe',
                    fontSize:'12px',
                    fontFamily:'微软雅黑'
                }
            },
            lineWidth: 1
        },
        legend:{
            align: 'right',
            verticalAlign: 'top',
            itemStyle:{
                cursor: 'pointer',
                color: '#cbd9fe'
            },
            itemHoverStyle:{
                color: 'rgb(0,205,185)'
            },
            itemHiddenStyle:{
                color: 'rgba(0,0,0,.3)'
            }
        },
        tooltip: {
            headerFormat: '<b>{point.key}</b><br>',
            pointFormat: '<span style="color:{series.color}">\u25CF</span> {series.name}: {point.y} / {point.stackTotal}'
        },
        plotOptions: {
            column: {
                // stacking: 'normal',
                depth: 25,
                dataLabels: {
                    align: 'center',
                    enabled: true, // dataLabels设为true
                    useHTML: true,
                    style: {
                        color: '#cbd9fe',
                        fontSize: '12px',
                        fontWeight: 'normal',
                        fontFamily: '微软雅黑'

                    },
                    x:0,
                    y: 0
                }
            }
        },
        series: [{
            name: '线索(文件)',
            data: obj_3.no_Num,
            stack: 'ss'
        }, {
            name: '线索(文字)',
            data: obj_3.data_3_Clue,
            stack: 'male'
        }, {
            name: '案件',
            data: obj_3.data_3_Case,
            stack: 'female'
        }]
    });
}
//仪表盘详情
function dashboard(item,num){
    var value_1 = [],
        value_2 = [],
        type = '{b}';
    if(num == 0){
        for(var i = 0; i < eg.aqg.length; i++){
            value_1.push((100 - Number(eg.aqg[i])));
        }
        value_2 = eg.aqg;
        type = '{b}%';
    }
    if(num  == 1){
        for(var i = 0; i < eg.zdajfas.length; i++){
            value_1.push((100 - Number(eg.zdajfas[i])));
        }
        value_2 = eg.zdajfas;
    }
    if(num == 3){
        for(var i = 0; i < eg.xxmapal.length; i++){
            value_1.push((100 - Number(eg.xxmapal[i])));
        }
        value_2 = eg.xxmapal;
        type = '{b}%';
    }
    if(num == 4){
        for(var i = 0; i < eg.bdlxsapal.length; i++){
            value_1.push((100 - Number(eg.bdlxsapal[i])));
        }
        value_2 = eg.bdlxsapal;
        type = '{b}%';
    }
    if(num == 5){
        for(var i = 0; i < eg.lqxsxzpal.length; i++){
            value_1.push((100 - Number(eg.lqxsxzpal[i])));
        }
        value_2 = eg.lqxsxzpal;
        type = '{b}%';
    }
    if(num == 6){
        for(var i = 0; i < eg.dqajpal.length; i++){
            value_1.push((100 - Number(eg.dqajpal[i])));
        }
        value_2 = eg.dqajpal;
        type = '{b}%';
    }
    if(num == 7){
        for(var i = 0; i < eg.jcxzpapal.length; i++){
            value_1.push((100 - Number(eg.jcxzpapal[i])));
        }
        value_2 = eg.jcxzpapal;
        type = '{b}%';
    }
    if(num == 8){
        for(var i = 0; i < eg.fjcxzpapal.length; i++){
            value_1.push((100 - Number(eg.fjcxzpapal[i])));
        }
        value_2 = eg.fjcxzpapal;
    }
    if(num == 9){
        for(var i = 0; i < eg.szxxxpal.length; i++){
            value_1.push((100 - Number(eg.szxxxpal[i])));
        }
        value_2 = eg.szxxxpal;
    }
    var obj =  {
        labelFromatter: [
            {
                normal : {
                    label : {
                        formatter : function (params){
                            return params.value
                        },
                        textStyle: {
                            baseline : 'top'
                        }
                    }
                }
            }
        ],
        name: eg.dwmc.length > 0 ? eg.dwmc : ["南明分局", "云岩分局", "花溪分局", "乌当分局", "白云分局", "经开分局", "开阳县分局", "息烽县分局", "修文县分局", "观山湖区分局", "清镇市分局"],
        orgCode: eg.orgCode.length > 0 ? eg.orgCode : ["520102", "520103", "520111", "520112", "520113", "520114", "520121", "520122", "520123", "520160", "520181"],
        value_1: value_1,
        value_2: value_2,
        type: type
    };
    window.sessionStorage.setItem('obj',JSON.stringify(obj));
    layer.open({
        type: 2,
        title: ['指标:' + item,'background: #3444a3;color:#fff'],
        shadeClose: true,
        shade: 0.8,
        area: ['810px', '600px'],
        offset: 'auto',
        content: 'screen/dashboard.html'
    });
// $.ajax({
//     type: 'get',
//     url: baseUrl,
//     data:{
//
//     },
//     beforeSend: function(){
//         Loading();
//     },
//     success: function(response){
//         closeLoading();
//         if(response.responseCode == '1000'){
//
//         }else{
//             Msg();
//         }
//     },
//     error: function(){
//         closeLoading();
//         Msg();
//     }
// })
}
//
function caseTypeDetail(item,num){
    window.sessionStorage.setItem('data',JSON.stringify(eg));
    layer.open({
        type: 2,
        title: [item,'background: #3444a3;color:#fff'],
        shadeClose: true,
        shade: 0.8,
        area: ['1200px', '600px'],
        offset: 'auto',
        content: 'screen/caseType.html?num=' + num
    });
}

//专案要案详情
function relationShip(){
    layer.open({
        type: 2,
        title: ['详情','background: #3444a3;color:#fff'],
        shadeClose: true,
        scrollbar: false,
        shade: 0.8,
        area: ['810px', '600px'],
        offset: 'auto',
        content: 'screen/relationShip.html'
    });
}

//饼图详情数据填充
function IframeData(response,iframeData){
    //云岩
    response.content.Z520103 ? iframeData.push(response.content.Z520103[0].AMOUNT) : iframeData.push(0);
    //乌当分局
    response.content.Z520112 ? iframeData.push(response.content.Z520112[0].AMOUNT) : iframeData.push(0);
    //经开分局
    response.content.Z520114 ? iframeData.push(response.content.Z520114[0].AMOUNT) : iframeData.push(0);
    //开阳县分局
    response.content.Z520121 ? iframeData.push(response.content.Z520121[0].AMOUNT) : iframeData.push(0);
    //修文县分局
    response.content.Z520123 ? iframeData.push(response.content.Z520123[0].AMOUNT) : iframeData.push(0);
    //观山湖区分局
    response.content.Z520160 ? iframeData.push(response.content.Z520160[0].AMOUNT) : iframeData.push(0);
    //南明分局
    response.content.Z520102 ? iframeData.push(response.content.Z520102[0].AMOUNT) : iframeData.push(0);
    //白云分局
    response.content.Z520113 ? iframeData.push(response.content.Z520113[0].AMOUNT) : iframeData.push(0);
    //花溪分局
    response.content.Z520111 ? iframeData.push(response.content.Z520111[0].AMOUNT) : iframeData.push(0);
    //息烽县分局
    response.content.Z520122 ? iframeData.push(response.content.Z520122[0].AMOUNT) : iframeData.push(0);
    //清镇市分局
    response.content.Z520181 ? iframeData.push(response.content.Z520181[0].AMOUNT) : iframeData.push(0);
}
function photoScroll(){
    $('.faceImg').vmcSlider({
        width: $('.faceImg').width(),
        height: $('.faceImg').height(),
        gridCol: 10,
        gridRow: 5,
        gridVertical: 20,
        gridHorizontal: 10,
        autoPlay: true,
        ascending: true,
        effects: [
            'fade', 'fadeLeft', 'fadeRight', 'fadeTop', 'fadeBottom', 'fadeTopLeft', 'fadeBottomRight',
            'blindsLeft', 'blindsRight', 'blindsTop', 'blindsBottom', 'blindsTopLeft', 'blindsBottomRight',
            'curtainLeft', 'curtainRight', 'interlaceLeft', 'interlaceRight', 'mosaic', 'bomb', 'fumes'
        ],
        ie6Tidy: false,
        random: false,
        duration: 5000,
        speed: 900
    });
}
